package com.omesoft.hksnore.util.web;

import android.content.ServiceConnection;

import org.ksoap2clone.transport.HttpTransportSE;

import java.io.IOException;

/**
 * Created by Omesoft on 2016/11/20.
 */

public class MyAndroidHttpTransport extends HttpTransportSE {

    private int timeout = 30000; // 默认超时时间为30s

    public MyAndroidHttpTransport(String url) {
        super(url);
    }

    public MyAndroidHttpTransport(String url, int timeout) {
        super(url);
        this.timeout = timeout;
    }

    protected ServiceConnection getServiceConnection(String url)
            throws IOException {
        ServiceConnectionSE serviceConnection = new ServiceConnectionSE(url);
        serviceConnection.setConnectionTimeOut(timeout);
        return (ServiceConnection) new ServiceConnectionSE(url);
    }
}
